<?php


namespace App\Admin\Controllers;


use App\Models\ExpressCompany;
use SmallRuralDog\Admin\Components\Attrs\SelectOption;
use SmallRuralDog\Admin\Components\Form\Checkbox;
use SmallRuralDog\Admin\Components\Form\InputNumber;
use SmallRuralDog\Admin\Components\Form\Select;
use SmallRuralDog\Admin\Components\Form\Upload;
use SmallRuralDog\Admin\Components\Grid\Image;
use SmallRuralDog\Admin\Controllers\AdminController;
use SmallRuralDog\Admin\Form;
use SmallRuralDog\Admin\Grid;

class ExpressCompanyController extends AdminController
{

    public function grid()
    {
        $grid = new Grid(new ExpressCompany());
        $grid->column('id', '编号')->width(180);
        $grid->column('name', '公司名称')->width(280);
        $grid->column('code', '公司代码')->width(220);

        $grid->toolbars(function (Grid\Toolbars $toolbars) {
        });

        return $grid;
    }

    public function form($isEdit = false)
    {
        $form = new Form(new ExpressCompany());

        $form->item('name', '公司名称')->required()->inputWidth(5);
        $form->item('code', '公司代码')->required()->inputWidth(5);

        return $form;
    }
}
